using Engine;
using Engine.Graphics;
using GameEntitySystem;

namespace SCIENEW {
    public abstract class Fluid {
        /// <summary>
        /// 流体的名称
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual string GetDisplayName(int value) => string.Empty;

        /// <summary>
        /// 流体的字符串ID
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual string GetCraftingID(int value) => GetType().Name;

        /// <summary>
        /// 流体的详细解释
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual string GetDescription(int value) => string.Empty;

        /// <summary>
        /// 流体在格子里显示的材质
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual Texture2D GetTexture(int value) => FluidsManager.NormalFluidTexture;

        /// <summary>
        /// 流体材质的细分数量
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual int GetTextureSubdivision(int value) => 6;

        /// <summary>
        /// 流体材质的格子序号
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual int GetTextureSlot(int value) => 0;

        /// <summary>
        /// 流体在格子里显示的颜色
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual Color GetColor(int value) => Color.White;

        /// <summary>
        /// 流体的特殊值流体数量
        /// </summary>
        /// <returns></returns>
        public virtual int GetCongenericFluidCount() => 1;

        /// <summary>
        /// 流体散发时会调用
        /// </summary>
        /// <param name="project"></param>
        /// <param name="position"></param>
        /// <param name="velocity"></param>
        public virtual void Emit(Project project, Vector3 position, Vector3 velocity){}

        /// <summary>
        /// 流体是否发光
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public virtual bool IsGlow(int value) => false;
    }
}